function setTime() {
	//alert("setTime");
	var str = "";
	var time = new Date();
	var h = time.getHours();
	if (h < 10)
		str += "0" + h;
	else
		str += h;
	str += ":";
	var m = time.getMinutes();
	if (m < 10)
		str += "0" + m;
	else
		str += m;
	str += ":";
	var s = time.getSeconds();
	if (s < 10)
		str += "0" + s;
	else
		str += s;
	str += "&nbsp;" + (time.getMonth() + 1) + "月" + time.getDate() + "日&nbsp;";
	var d = time.getDay();
	switch (d) {
	case 1:
		str += "星期一";
		break;
	case 2:
		str += "星期二";
		break;
	case 3:
		str += "星期三";
		break;
	case 4:
		str += "星期四";
		break;
	case 5:
		str += "星期五";
		break;
	case 6:
		str += "星期六";
		break;
	case 0:
		str += "星期天";
		break;
	}
	//var str=time.getHours()+":"+time.getMinutes()+":"+time.getSeconds();
	document.getElementById("time").innerHTML = str;
	setTimeout("setTime();", 1000);
}

function addFolderWin() {
	showWindow(
			'添加文件夹',
			'<div align="center" id="addfolder" ><h4 style="margin:10px 0;'
					+ 'padding-buttom:0">添加文件夹</h4><p class="error">&nbsp;</p><table><tr>'
					+ '<td><label for="foldername">文件夹名字:</label></td><td>'
					+ '<input type="text" id="foldername" size="28"/></td></tr><tr><td><label for="folderother">'
					+ '文件夹说明:</label></td><td><textarea rows="3" cols="25" id="folderother">'
					+ '</textarea></td></tr></table><br/><button onclick="new addFolder(this).add();">'
					+ '确定</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' +
					'<button onclick="winClose()">取消</button><br/>&nbsp;</div>');
}

function addMailboxWin() {
	showWindow(
			"添加邮箱",
			"<div align=\"center\" id=\"addmailbox\" ><h4 style=\"margin:10px 0;padding-buttom:0\">添加邮箱</h4>"
					+ "<p class=\"error\">&nbsp;</p><table><tr><td><label for=\"mailbox_address\">邮箱地址：</label>"
					+ "</td><td><input type=\"text\" id=\"mailbox_address\"/></td></tr>"
					+ "<tr><td><label for=\"mailbox_password\">邮箱密码：</label></td><td><input type=\"password\" "
					+ "id=\"mailbox_password\"/></td></tr></table><br/>"
					+ "<button onclick=\"new addMailbox(this).add();\">确定</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
					+ "<button onclick=\"winClose()\">取消</button><p>&nbsp;</p></div>");
}

function showWindow(title, content) {
	//alert(document.body.clientWidth+" : "+document.body.clientHeight);
	//alert(document.body.offsetWidth+" : "+ document.body.offsetHeight);
	document.body.style.overflow = 'hidden';
	var divwin = document.createElement("div");
	divwin.id = "win"
	divwin.style.cssText = "height:2000px;background:#969696;filter:alpha(opacity=60);opacity:0.6;width:1500px;position:absolute;left:0px;top:0px";
	document.body.appendChild(divwin);
	document.body.appendChild(createWindow(title, content));
}
function createWindow(t, content) {
	var win = document.createElement("div");
	win.id = "win2";
	win.style.cssText = "min-height:200px;width:400px;position:absolute;top:80px;left:300px;background:#cccccc;border:1px solid #666";
	var title = document.createElement("div");
	//title.style.cssText="height:30px;width:400px;position:relative;top:0;left:0;";
	title.style.background = "#666";
	title.style.padding = "5px";
	title.innerHTML = "<table width=\"395px\"><tr><td><span style=\"color:#ccc;font-size:14px\">"
			+ t
			+ "</span></td><td align=\"right\"><span style=\"float:right;filter:alpha(opacity=20);opacity:0.2\"><a onclick=\"winClose();\" onmouseover=\"closeMouseOver(this);\" onmouseout=\"closeMouseOut(this);\"><img src=\"./image/close.png\"/></a></span></td></tr></table>";
	var con = document.createElement("div");
	//test();
	con.id = "winContent";
	con.cssText = "min-height=80px;width=400px";
	con.innerHTML = content;
	win.appendChild(title);
	win.appendChild(con);
	return win;
}
function closeMouseOver(obj) {
	//alert(obj.parentNode.innerHTML);
	//alert(obj.parentNode.filters.alpha.opacity);
	obj.parentNode.style.filter = "alpha(opacity=60)";
	obj.parentNode.style.opacity = 0.6;
	//obj.parentNode.style.cssText+="filter:alpha(opacity=90);opacity:0.9;";
}
function closeMouseOut(obj) {
	obj.parentNode.style.filter = "alpha(opacity=20)";
	obj.parentNode.style.opacity = 0.2;
}
function winClose() {
	document.body.removeChild(document.getElementById("win"));
	document.body.removeChild(document.getElementById("win2"));
	document.body.style.overflow = 'auto';
}
function winClose2() {
	document.body.removeChild(document.getElementById("win2"));
}
function test() {
	alert("weihua1413");
}